<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>微信支付</title>
</head>
<body>
<br/>
<font color="#9ACD32"><b>该笔订单支付金额为<span style="color:#f00;font-size:50px">{$money}元</span>钱</b></font><br/><br/>
<div align="center">
    <button style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;" type="button" onclick="callpay()" >立即支付</button>
</div>
</body>
<script type="text/javascript">
    function onBridgeReady(){
        var str = '{$jsApiParameters}';
        var obj = JSON.parse(str);
        WeixinJSBridge.invoke(
            'getBrandWCPayRequest', {
                "appId":obj.appId,     //公众号名称，由商户传入
                "timeStamp":obj.timeStamp,         //时间戳，自1970年以来的秒数
                "nonceStr":obj.nonceStr, //随机串
                "package":obj.package,
                "signType":obj.signType,         //微信签名方式：
                "paySign":obj.paySign //微信签名
            },
            function(res){
                if(res.err_msg == "get_brand_wcpay_request:ok" ){
                    // 使用以上方式判断前端返回,微信团队郑重提示：
                    //res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
                    window.location.href="{:cmf_plugin_url('QbtOrder://Index/pay_success')}";
                }
            });
    }

    function callpay()
    {
        if (typeof WeixinJSBridge == "undefined"){
            if( document.addEventListener ){
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            }else if (document.attachEvent){
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        }else{
            onBridgeReady();
        }
    }
</script>
</html>